The present invention relates generally to the field of query optimization systems, and more particularly to cloud-implemented query optimization systems.
Broadly speaking, a database is any organized, or “structured,” collection of data. Many types of databases are known, including navigational, relational, object-oriented, and document-oriented databases, to name a few. Databases are created, managed, and accessed by database management systems (DBMS), which typically include facilities for defining data models using some form of a data description/data definition language (DDL), specifying logical and physical storage organization for the database, and accessing, manipulating, and reporting on the data stored therein. A DBMS may store metadata about a database instance. This metadata, or catalog, can include information about database object structures, relationships, and states, as well as information and statistics about those objects, requests to access them, and the database system environment.
Data in a database is normally accessed and manipulated through the use of queries. The specific way in which a DBMS accesses data in response to a query is known as a query plan, execution plan, access plan, or simply a plan. There are often multiple possible plans for retrieving requested information from a given database, including multiple possible table joining and filtering sequences, multiple methods for joining tables, and multiple methods for accessing table data. The way in which a query is written or otherwise supplied may influence the actual plan to be used. For example, the selection and organization of the commands included in the query may direct or suggest the specific characteristics that a plan should have, as may any plan hints that might be associated with the query.
The specifics of queries and their associated plans can have a significant impact on query performance. In addition to the intrinsic organization of the query and plan themselves, various extrinsic factors can influence query performance as well, including the logical and physical organization of the database, characteristics of the data (for instance, table size), and characteristics of the hosting environment(s). For these reasons, there is significant interest in query tuning, which seeks to maximize query performance and/or minimize query costs by configuring the query plan, database, and/or hosting environment in an effective manner to accomplish these goals. Query tuning may be done during database design and development, but, because some database characteristics, including queries, may not be known beforehand or may change over time, query tuning may also be beneficial if done during the production lifetime of the database. Any controllable factors of the query, the database, or its environment may be changed during query tuning. Furthermore, query tuning may be done with respect to a specific query or, because changes that improve performance for one query may degrade it for another, query tuning may be done with respect to a collection of queries, known as a query workload. In the case of a query workload, tuning can include characteristics of the workload as a whole, such as relative query frequency or importance, in addition to characteristics of the individual queries themselves.